//
//  MCUserDefaults.h
//  MClient
//
//  Created by  史正烨 on 10-8-25.
//  功能：管理nsuserdefaults的存取操作
//  Copyright 2010 __MyCompanyName__. All rights reserved.
//

#import <Foundation/Foundation.h>


@interface MCUserDefaults : NSObject {
	NSUserDefaults *defaults;
	BOOL          isDemoApplication;
	BOOL          needScreenVHChange;
	BOOL		  needModifyPassword;
	BOOL		  needServerEditor;
	NSDictionary* _needLogoHeader;
	NSDictionary* guestDefaultLogin;
	NSMutableDictionary* LoginWithHidePartyId;
	NSString*     defaultServerUrl;
	NSDictionary* skinsPlist;
	int           packegeSkinNumber;
	BOOL          useShrinkTreeView;
	BOOL          dragListLastAndMore;
	BOOL          remoteNotification;
	BOOL          useLastMenuAsShortKey;
	BOOL		  contactSync;
}

//皮肤通过下载，皮肤包里面有一个配置文件，此map就是读取该文件做成的。
@property(nonatomic,retain,readonly) NSDictionary*    skinsPlist;
//如果在MClientConstant.plist里面有“GuestDefaultLogin”项，表明没有登录界面，直接
//通过guest帐号登录，此map就是读取该项对应的帐号密码等信息做成的，有了该项则是自动登录的
@property(nonatomic,retain,readonly) NSDictionary*    guestDefaultLogin;
//隐藏partyid，此在初始化界面或系统的设置界面操作
@property(nonatomic) bool    isHidePartyId;
//保存密码，此在初始化界面或系统的设置界面或应用的setting界面操作
@property(nonatomic) bool    isSavePassword;
//自动登录，此在初始化界面或系统的设置界面或应用的setting界面操作
@property(nonatomic) bool    isAutoLogin;
//如果在MClientConstant.plist里面有“isDemoApplication”项，表明是否是演示应用
@property(nonatomic,assign,readonly) BOOL    isDemoApplication;
@property(nonatomic) bool    isShowHelp;
@property(nonatomic) bool    isGridMenu;
//附件(rar、zip、doc、docx、txt)预览调用平台接口
@property(nonatomic) bool    isShowOpenOffice;

@property(nonatomic) int     currentReq;
@property(nonatomic) int     currentRes;
@property(nonatomic) int     currentDayReq;
@property(nonatomic) int     currentDayRes;
@property(nonatomic) int     currentMonthReq;
@property(nonatomic) int     currentMonthRes;
@property(nonatomic) int     totalReq;
@property(nonatomic) int     totalRes;


//横竖屏切换开关，可在系统的设置界面或应用的设置页面配置
@property(nonatomic, assign,readonly) BOOL    needScreenVHChange;
//是否需要添加修改秘密按钮
@property(nonatomic, assign,readonly) BOOL    needModifyPassword;
//是否需要显示服务器地址
@property(nonatomic, assign,readonly) BOOL    needServerEditor;
@property(nonatomic, retain) NSMutableDictionary*     serverList;
@property(nonatomic, assign) NSString*     current_ServerUrl;
@property(nonatomic, assign) NSString*     current_PartyId;
@property(nonatomic, assign) NSString*     current_UserId;
@property(nonatomic, assign) NSString*     current_Password;

@property(nonatomic, assign) NSString*     current_GuestUserId;
// 存取最后接收消息时间
@property(nonatomic, assign) NSString*     ctime;
// 设置收取消息时间
@property(nonatomic) int     msgTime;
// 推送消息，需要从苹果aps服务器注册
@property (nonatomic, retain)NSString* deviceToken;

@property(nonatomic, assign)  NSString*     bundlePath;
@property(nonatomic, assign,readonly) BOOL  isFirstUse;
@property(nonatomic) bool isSetupFirst;

@property(nonatomic, assign,readonly) int           skin_number;
@property(nonatomic, assign) int                    skin_index;
@property(nonatomic, assign,readonly) UIImage*      skin_bgViewImg;
@property(nonatomic, assign,readonly) UIImage*      skin_bgMenuCellImg;
@property(nonatomic, assign,readonly) UIImage*      skin_bgListLabelImg;
@property(nonatomic, assign,readonly) UIImage*      skin_bgSectionImg;
@property(nonatomic, assign,readonly) UIImage*      skin_bgLoginImg;
@property(nonatomic, assign,readonly) UIImage*      skin_btnLoginImg;
@property(nonatomic, assign,readonly) UIImage*      skin_btnAboutImg;
@property(nonatomic, assign,readonly) UIImage*      skin_btnAccountImg;
@property(nonatomic, assign,readonly) UIImage*      skin_btnConfigImg;
@property(nonatomic, assign,readonly) UIImage*      skin_btnDemoImg;
@property(nonatomic, assign,readonly) UIImage*      skin_logintitleImg;
@property(nonatomic, assign,readonly) UIImage*      skin_loginlogoImg;
@property(nonatomic, assign,readonly) UIImage*      skin_logoTitle;
@property(nonatomic, assign,readonly) UIImage*      skin_withFormButtonBg;
@property(nonatomic, assign,readonly) UIImage*      skin_bgAListEvenBg;
@property(nonatomic, assign,readonly) UIImage*      skin_bgAListOddBg;

@property(nonatomic, assign,readonly) UIColor*      skin_navigationBarColor;
@property(nonatomic, assign,readonly) UIColor*      skin_tabBarColor;
@property(nonatomic, assign,readonly) UIColor*      skin_bgListLabelSpaceColor;
@property(nonatomic, assign,readonly) UIColor*      skin_bgTableEvenColor;
@property(nonatomic, assign,readonly) UIColor*      skin_bgTableOddColor;
@property(nonatomic, assign,readonly) UIColor*      skin_segmentedControlColor;
@property(nonatomic, assign,readonly) UIColor*      skin_withFormButtonFontColor;
@property(nonatomic, assign,readonly) UIColor*      skin_menuFontColor;

//高级列表各行变色，背景用自做view通过画图实现，但是分割线为展现为立体效果，此颜色会和换肤考虑
@property(nonatomic, assign,readonly) UIColor*    listViewCellRectColor_Odd;
@property(nonatomic, assign,readonly) UIColor*    listViewCellRectColor_Even;
@property(nonatomic, assign,readonly) UIColor*    listViewCellLineColor;
@property(nonatomic, assign,readonly) UIColor*    listViewCellLineLowColor;

//表单页面标题颜色
@property(nonatomic, assign,readonly) UIColor*    viewCellTitleBackgroundColor;

@property(nonatomic, assign,readonly) BOOL    needLogoHeader;
@property(nonatomic, readonly) NSDictionary*  logoHeader;
@property(nonatomic, assign,readonly) BOOL    hideNavigationBar;
@property(nonatomic, assign,readonly) int     packegeSkinNumber;
@property(nonatomic, assign,readonly) BOOL    needHidePartyId;

@property(nonatomic, assign,readonly) BOOL    useShrinkTreeView;
@property(nonatomic, assign,readonly) BOOL    dragListLastAndMore;
//是否支持远程通知：苹果的推送机制
@property(nonatomic, assign,readonly) BOOL    remoteNotification;
//在menu界面向下迁移时，是否将menu作为下一页面的快捷，注意，这只有在没有静态全局快捷时有效
@property(nonatomic, assign,readonly) BOOL    useLastMenuAsShortKey;

@property(nonatomic, assign,readonly) BOOL    contactSync;

// 静态全局的改对象实例
+ (MCUserDefaults *)instance;

- (UIImage*)bgViewImage:(int)index;
- (UIColor*)navigationBarColor:(int)index;
- (NSString*)skinName:(int)index;
- (Class)class:(NSString*)aClass;
@end
